home *** CD-ROM | disk | FTP | other *** search
/ Champak 119 / (Vol 119) Nov 09 2010.iso / Games / tobby_ura_ura.swf / scripts / DefineSprite_109 / frame_1 / DoAction.as
Text File  |  2010-11-09  |  1KB  |  59 lines

  1. function main()
  2. {
  3.    if(this.procNum == 1)
  4.    {
  5.       if(this.presentFlg == false)
  6.       {
  7.          this.checktobby();
  8.       }
  9.    }
  10. }
  11. function checktobby()
  12. {
  13.    var dx = Math.abs(_root.tobbyMC._x - (_root.mapMC._x + this._x));
  14.    if(dx < this.mesXarea && this.outAreaFlg == true)
  15.    {
  16.       this.openMes();
  17.       if(this.presentFlg == false)
  18.       {
  19.          this.attachMovie("NPC_present","presentMC",10);
  20.          this.presentMC._x = -50;
  21.          this.presentMC._y = -120;
  22.          this.presentFlg = true;
  23.       }
  24.    }
  25.    else
  26.    {
  27.       this.outAreaFlg = true;
  28.    }
  29. }
  30. function openMes()
  31. {
  32.    this.mesMC.gotoAndStop(this.getLabelName());
  33.    this.mesMC._visible = true;
  34.    this.openMesFlg = true;
  35. }
  36. function getLabelName()
  37. {
  38.    if(20 >= _root.getHosekiCnt)
  39.    {
  40.       return "a";
  41.    }
  42.    if(25 >= _root.getHosekiCnt)
  43.    {
  44.       return "b";
  45.    }
  46.    return "c";
  47. }
  48. function mesClose()
  49. {
  50.    this.mesMC._visible = false;
  51. }
  52. this.mesMC._visible = false;
  53. this.outAreaFlg = true;
  54. this.presentFlg = false;
  55. this.mesXarea = 50;
  56. this.pCnt = 0;
  57. this._visible = true;
  58. this.procNum = 1;
  59.